package cn.jtcoding.xhs.service.impl;

import cn.jtcoding.xhs.dao.CategoryDao;
import cn.jtcoding.xhs.model.convert.CategoryConvert;
import cn.jtcoding.xhs.model.dataobject.CategoryDO;
import cn.jtcoding.xhs.model.vo.CategoryVO;
import cn.jtcoding.xhs.service.CategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author jason.tang
 * @Date 2020/8/4 19:56
 * @Desc
 */

@Slf4j
@Service
public class CategoryServiceImpl implements CategoryService {

    @Autowired
    private CategoryDao categoryDao;

    @Override
    public List<CategoryVO> getCategoryList() {
        List<CategoryDO> categoryDOs = categoryDao.getCategoryList();
        return CategoryConvert.INSTANCE.categoriesToVO(categoryDOs);
    }
}
